<link href="/css/client.css" type="text/css" rel="stylesheet">
<link href="/css/dropdown.css" type="text/css" rel="stylesheet">
<link href="/css/fancybox.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src="../js/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="../js/jquery.tablesorter.pager.js"></script>
<script type="text/javascript" src="../js/jquery.liveFilter.js"></script>
<script>        
    $(document).ready(function() {
        $("#clients").tablesorter({headers: {
            6:{sorter: false},
            4:{sorter:false},
        }});
        $('.table_filter').liveFilter({
            delay: 300,
            defaultText: 'enter keyword to search',
            hideDefault: false
        }); 
        $(".modal").fancybox({
            'width': '75%',
            'height':'75%',
            'autoScale': false,
            'transitionIn': 'none',
            'transitionOut': 'none',
            'type': 'iframe'            
        }); 
    });                     
</script>
<?php       
    echo $this->render('header.phtml');
    echo $this->render('client/subnav.phtml');
?>
<section id="main" class="clients">
    <div class="title">Clients</div>
    <div class="table_filter">
    <table id="clients" class="main">
        <thead>
            <tr>
                <td colspan="4"><input class="live-search" type="text" value="" /></td>
                <td colspan="3" class="textright">
                    <input type="radio" id="action" class="b-dropdown-helper" name="dropdowns"/> 
                    <span class="b-dropdown right"> 
                        <label class="b-dropdown-handles square" for="action">Export</label> 
                        <span class="b-dropdown-popup"> 
                            <span class="b-dropdown-popup-in"> 
                                <span class="b-dropdown-popup-inin"> 
									<a class="b-dropdown-link" href="#two">
                                        <img src="/img/fugue/report-excel.png" />export to excel
                                    </a> 
                                    <a class="b-dropdown-link" href="#three">
                                        <img src="/img/fugue/document-pdf-text.png" />export to pdf
                                    </a> 
                                    <a class="b-dropdown-link" href="#four">
                                        <img src="/img/fugue/mail-open-document.png" />send e-mail
                                    </a>      
                                </span> 
                            </span> 
                        </span> 
                    </span> 
                    <!-- Сервисные блоки (паранджа для дропдаунов) -->
                    <input type="radio" id="Paranja" class="b-paranja-helper" name="dropdowns" checked="checked" />
                    <label class="b-paranja" for="Paranja"></label>
                    <!-- / Сервисные блоки -->

                    <a href="/client/add" class="button" style="right: 10px; top: -13px;"><img src="../img/fugue/plus-circle.png">Add New</a>
                </td>
            <tr>
                <th>ID</th><th>Organization</th><th>VAT</th><th>Full name</th><th>Address</th><th>Phone</th><th>E-mail</th>
            </tr>
        </thead>
        <tbody>
<?php
    if ($this->clients && count($this->clients))
    foreach($this->clients as $c) { ?>
        <tr><td><?= $c->id ?></td>
            <td><?= $c->organization ?></td>
            <td><?= $c->vat ?></td>
            <td><?= $c->getName() ?></td>
            <td><?= $c->getAddress() ?></td>
            <td><?= $c->telephone ?></td>
            <td><?= $c->email_work ?></td>
        </tr>
<?php    
    } ?>
        </tbody>                
    </table>
</div> 
<?php     
    if (!empty($this->error)) echo '<div class=error>'.$this->error.'</div>';    
    if (!empty($this->message)) echo '<div class="flash">'.$this->message.'</div>';
?>    
</section>
<?php echo $this->render('footer.phtml'); ?>